package com.example.arithmeticleetcode.leetcode.october;

/**
 * @program: arithmetic-leetcode
 * @description:
 * @author: FangZhen
 * @create: 2020-10-12 09:21
 **/
public class Demo03 {

    public static void main(String[] args) {

    }

    public static int maxDepth(String s) {
        int deep = 0, t = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '(') {
                t ++;
                deep = Math.max(deep, t);
            } else if (s.charAt(i) == ')') {
                t --;
            }
        }
        return deep;

    }
}
